Field of the Invention
The present invention relates to a receiving device for receiving data. The receiving device extracts from received data a specific part thereof and, depending on a content of the extracted data, decides how it must handle the received data.
Receiving devices of this type are used for example in units connected to a controller area network (CAN) bus. CANs are a widely used network that has been known for many years for connecting units disposed in a decentralized manner.
The units connected to a CAN bus contain a CAN controller which is responsible for outputting data to be transmitted onto the CAN bus and/or for receiving data transmitted via the CAN bus and contains, inter alia, the above-mentioned receiving device. Further components (for example a CPU) which provide the data to be transmitted and/or process the received data, and interfaces between the CAN controller and the further components of the units connected to the CAN bus. The interfaces are designated as message objects and are formed by memories or memory areas of greater or lesser size.
In the case of CAN, data are transmitted in units of so-called messages. A message contains a specific number of data bits and is subdivided into a plurality of fields. One of the fields is the so-called identifier field. The identifier field contains 11 bits (standard CAN identifier) or 29 bits (in the case of the CAN 2.0B protocol) and contains details about the content of the received data, more precisely details about the information requested or transmitted by the relevant message.
The data contained in the identifier field may specify, for example, that the relevant message relates to an oil temperature, more precisely that the data that are actually to be transmitted (and are transmitted in the so-called data field of the message) are the oil temperature, or that the information requested by the unit which outputs the message is the oil temperature.
The content of the identifier field is that part of the data which the receiving device extracts from the received data (from the message) in order to define how it must handle the received data (the message).
In the example considered, i.e. when the receiving device is used in a CAN controller, the receiving device decides, depending on the content of the identifier field, whether and, if appropriate, to which message object the respective message is to be fed.
If, by way of example, the identifier field indicates that the message containing the identifier field relates to the oil temperature, then the receiving devices of all the units which operate in a manner dependent on the oil temperature or require information items regarding the oil temperature for other purposes, or the receiving devices of all the units which can determine and output the oil temperature, receive the relevant message and forward it or selected parts thereof to the message object which is assigned to that component of the unit containing the receiving device which processes or determines the oil temperature. The receiving devices of all other units disregard the relevant message.
Various possibilities exist for determining how the receiving device must handle data (messages) received via the CAN bus.
A first possibility is illustrated in FIG. 2 and is described below with reference thereto.
The configuration illustrated in FIG. 2 shows parts of the receiving device and the message objects of a unit connected to a CAN bus CAN and contains an extraction device EXT, message objects MO1, MO2, . . . , MOn, an XOR element XOR, an AND element AND, and a comparison device C. The extraction device EXT extracts the identifier field from messages transmitted via the CAN bus CAN and stores it in an identifier memory EXT-IM. The message objects MO1, MO2, . . . , MOn each contain an identifier memory MO1-IM, MO2-IM, . . . and MOn-IM, respectively, an acceptance mask memory MO1-AM, MO2-AM, . . . and MOn-AM, respectively, and further memories MO1-DATA, MO2-DATA, . . . and MOn-DATA, respectively, and MO1-CTRL, MO2-CTRL, . . . and MOn-CTRL, respectively. An identifier assigned to the respective message objects is in each case stored in the identifier memories MO1-IM, MO2-IM, . . . and MOn-IM. Acceptance masks assigned to the respective message objects are stored in the acceptance mask memories MO1-AM, MO2-AM, . . . and MOn-AM, and there being stored in the memories MO1-DATA, MO2-DATA, . . . and MOn-DATA and MO1-CTRL, MO2-CTRL, . . . and MOn-CTRL the messages or selected parts of the messages whose identifiers correspond to the identifiers stored in the respective message objects in the parts determined by the respective acceptance mask. The XOR element subjects the identifier stored in the identifier memory EXT-IM of the extraction device EXT and the identifier stored in the identifier memory MO1-IM, MO2-IM, . . . and MOn-IM of a selected message object MO1, MO2, . . . and MOn, respectively, to XORing bit by bit. The AND element AND subjects the result of the XORing and the acceptance mask stored in the acceptance mask memory MO1-AM, MO2-AM, . . . and MOn-AM of the selected message object MO1, MO2, . . . and MOn, respectively, to ANDing bit by bit. The comparison device C checks whether the result of the ANDing is equal to or not equal to zero.
The receiving device checks by the above-mentioned XORing and the above-mentioned ANDing in order for each message object whether the identifier extracted from the currently transmitted message by the extraction device EXT corresponds to the identifier stored in the respective message objects in the parts determined by the respective acceptance mask. Such correspondence is present if the value zero is output by the AND element AND. When a correspondence is ascertained, the receiving device writes the currently transmitted message or selected parts thereof to the memories MO1-DATA, MO2-DATA, . . . and MOn-DATA, respectively, and MO1-CTRL, MO2-CTRL, . . . and MOn-CTRL, respectively, of the relevant message object. Otherwise, the check is continued for the next message object. If a correspondence does not result for any of the message objects, the receiving device disregards the currently transmitted message.
The operations that proceed in detail here will be described briefly using an example.
Suppose that the correspondence check begins with the first message object MO1. Then the identifier stored in the identifier memory EXT-IM of the extraction device EXT and the identifier stored in the identifier memory MO1-IM of the first message object MO1 are subjected to XORing, and the result of the XORing and the acceptance mask stored in the acceptance mask memory MO1-AM of the first message object MO1 are subjected to ANDing.
If the identifier stored in the identifier memory EXT-IM of the extraction device EXT and the identifier stored in the identifier memory MO1-IM of the first message object MO1 correspond, the XORing result and thus also the ANDing result are equal to 0. If the comparison device C ascertains that the value 0 is fed to it, it ends the correspondence check and causes the message currently transmitted via the CAN bus CAN or a selected part thereof to be stored in a memory area reserved therefore of the first message object MO1 and to be provided for fetching by another component.
If the identifier stored in the identifier memory EXT-IM of the extraction device EXT and the identifier stored in the identifier memory MO1-IM of the first message object MO1 do not correspond, it depends on the acceptance mask stored in the acceptance mask memory MO1-AM of the first message object MO1 whether the ANDing result becomes equal to 0 or not equal to 0. If the acceptance mask has a 0 at those locations at which the identifiers subjected to XORing differ, the result becomes equal to 0 in this case, too. The consequence of this, as in the case described above, is that the correspondence check ends, and the message currently transmitted via the CAN bus CAN or a selected part thereof is caused to be written to the first message object MO1 and to be provided for fetching by another component.
The provision of the acceptance mask and the ANDing thereof with the XORing result has the effect that the identifier extracted from the message is compared with a group of identifiers containing a plurality of different identifiers in a single work operation. This is expedient if messages having different identifiers can or must be fed to a message object, and proves to be advantageous because the number of correspondence checks can thereby be kept low.
If the ANDing result is not equal to 0, then the currently transmitted message is not a message that is to be fed to the message object MO1. The comparison device C thereupon causes the correspondence check to be continued with another message object, for example with the message object MO2, as a result of which a check is made to determine whether the currently transmitted message is a message which is to be fed to the message object MO2. The correspondence check is affected as with the first message object MO1.
If it is found in this case that the currently transmitted message is a message which is to be fed to the message object MO2, the correspondence check is ended and the message currently transmitted via the CAN bus CAN or a selected part thereof is caused to be stored in the memory area reserved therefore of the second message object MO2 and to be provided for fetching by another component.
By contrast, if the currently transmitted message is not a message which is to be fed to the message object MO2, then the comparison device C again causes the correspondence check to be carried out for another message object, for example for the message object MOn. In this case, the operations described above are repeated.
If the correspondence check has been carried out for all of the message objects and no message object to which the currently transmitted message is to be fed has been found, the receiving device does not receive the relevant message.
The above-described checking has serious disadvantages primarily when the unit containing the receiving device contains many message objects. It lasts a long time and, owing to the frequent accesses to the memory device forming the message objects, delays the fetching and further processing of the messages or message parts stored in the message objects. The provision of the acceptance masks only partly remedies this. For this purpose, it is necessary that the identifiers of the messages which are to be fed to a specific message object differ only in the bits masked out by the acceptance mask, and that only as many and such bits are masked out that the message objects are not also fed those message objects which are not intended to be fed to them at all, which, however, is in practice often not the case for various reasons which will not be discussed in any further detail here.
A further possibility for determining how the receiving device must handle data (messages) received via the CAN bus is illustrated in FIG. 3 and is described below with reference thereto.
The configuration illustrated in FIG. 3 shows parts of the receiving device and the message objects of a unit connected to a CAN bus CAN and contains an extraction device EXT, message objects MO1, MO2, . . . , MOn, a selection device SEL formed by a multiplexer, for example, and a (pointer) memory PM. The extraction device EXT corresponds to the extraction device EXT shown in FIG. 2. The message objects MO1, MO2, . . . , MOn correspond with regard to function and practical realization to the message objects MO1, MO2, . . . , MOn of the configuration shown in FIG. 2, but have no identifier memory and no acceptance mask memory and also do not store an identifier and an acceptance mask elsewhere. The pointer memory has a number of memory elements (that is to say 211 or 229 memory elements) corresponding to the number of possible identifiers and there being stored in each memory element a value (a pointer) which specifies which message object is to be fed a message with an identifier corresponding to the ordinal number of the respective memory element. The selection device SEL has a number of input terminals corresponding to the number of memory elements of the pointer memory and, on the input side, are connected to all the memory elements of the pointer memory PM. The selection device is controlled by the identifier extracted from the transmitted message, and outputs a pointer designating the message object to which the currently transmitted message is to be forwarded.
The pointer memory PM and the selection device SEL make it possible to determine in a single work operation whether and, if appropriate, to which message object the message currently transmitted via the CAN bus CAN is to be fed.
The same applies correspondingly to the case where the identifier extracted from the message is used as an address for addressing the pointer memory PM; in this case, the selection device SEL could be dispensed with.
The determination—which can be carried out by the configuration described—of whether and, if appropriate, to which message object the message currently transmitted via the CAN bus CAN is to be fed can be realized only with a very large outlay, however, in particular owing to the required size of the pointer memory PM, both in the case of hardware realization and in the case of software realization.